package com.itheima.bos.dao.impl;

import com.itheima.bos.dao.IUserDao;
import com.itheima.bos.dao.base.IBaseDaoImpl;
import com.itheima.bos.domain.User;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Mr.King on 2017/3/7.
 */
@Repository
public class UserDaoImpl extends IBaseDaoImpl<User> implements IUserDao {
    @Override
    public User findUaerByUsername(String username) {
        List<User> list = (List<User>) this.getHibernateTemplate().find("from com.itheima.bos.domain.User where username = ?",username);
        return list.get(0);
    }
}
